home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / comp / makefram.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  1.3 KB  |  41 lines

  1. /*
  2.                                 M A K E F R A M . C
  3. */
  4.  
  5. #include "iccomp.h"
  6.  
  7. void make_frame()
  8. {
  9.     register unsigned
  10.         fun_index,
  11.         index;
  12.     ESTRUC_
  13.         e;
  14.  
  15.     if (!(fun_index = funtab.n_defined))
  16.         return;
  17.  
  18.     fun_index--;
  19.  
  20.                                             /* set offset of 1st byte */
  21.     funtab.symbol[fun_index].var.vu.i->count =
  22.                                         (unsigned)ftell(s_bin);
  23.  
  24.                                             /* room for type-bytes */
  25.     funtab.symbol[fun_index].var.vu.i->ls.list.element =
  26.                         xrealloc(NULL, n_params * sizeof(char));
  27.                                             /* store # of params */
  28.     funtab.symbol[fun_index].var.vu.i->ls.list.size = n_params;
  29.                                             /* assign parameter types to str */
  30.     for (index = 0; index < n_params; index++)
  31.         ((char *)funtab.symbol[fun_index].var.vu.i->ls.list.element)[index] =
  32.                      (char)(local.symbol[index].var.type & ALLTYPES);
  33.  
  34.     if (local.n_defined - n_params)         /* any local variables ? */
  35.     {
  36.         e = stackframe(0);                  /* initialize empty frame */
  37.         gencode(&e, op_frame);              /* generate frame instruction */
  38.         outbin(e.code, e.codelen);          /* write to s_bin */
  39.         free(e.code);
  40.     }
  41. }